package com.ruoyi.system.service.module.event.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.module.event.EventPlan;
import com.ruoyi.system.domain.module.event.EventPlanInfo;
import com.ruoyi.system.domain.module.event.EventPlanWork;
import com.ruoyi.system.mapper.module.event.EventPlanWorkMapper;
import com.ruoyi.system.service.module.event.IEventPlanWorkService;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;


/**
 * 计划的任务：记录计划的状态和完成人的信息Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-28
 */
@Service
public class EventPlanWorkServiceImpl extends ServiceImpl<EventPlanWorkMapper, EventPlanWork> implements IEventPlanWorkService {

//	@Override
//	public Boolean getWork(ArrayList<Date> day, EventPlan eventPlan, EventPlanInfo info) {
//		EventPlanWork work = new EventPlanWork();
//		for (Date date:day){
//			work.setId(null);
//			work.setEventPlanId(eventPlan.getId());
//			work.setState(0L);
//			work.setPropertyId(eventPlan.getPropertyId());
//			work.setFinishType(info.getFinishType());
//			work.setEstateId(eventPlan.getEstateId());
//			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//			String time = simpleDateFormat.format(date);
//			String beginTime = time.replace("00:00:00",info.getBeginRangeTime()+":00");
//			String endTime = time.replace("00:00:00",info.getEndRangeTime()+":00");
//			try {
//				Date beginDate = simpleDateFormat.parse(beginTime);
//				Date endDate = simpleDateFormat.parse(endTime);
//				work.setBeginTime(beginDate);
//				work.setEndTime(endDate);
//			} catch (ParseException e) {
//				throw new RuntimeException(e);
//			}
//			this.save(work);
//		}
//		return true;
//	}
}
